home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_18 / PlaceObject2_822_87 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2008-09-24  |  1.0 KB  |  66 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.paused)
  3.    {
  4.       return undefined;
  5.    }
  6.    if(!_root.sound)
  7.    {
  8.       ufoS.setVolume(0);
  9.    }
  10.    if(getTimer() > resetTime)
  11.    {
  12.       changeDir();
  13.       resetTime = getTimer() + delay;
  14.    }
  15.    if(dir == "left")
  16.    {
  17.       _X = _X - speed;
  18.    }
  19.    if(dir == "right")
  20.    {
  21.       _X = _X + speed;
  22.    }
  23.    if(_X > 500)
  24.    {
  25.       dir = "left";
  26.    }
  27.    if(_X < 100)
  28.    {
  29.       dir = "right";
  30.    }
  31.    time++;
  32.    if(time > 80)
  33.    {
  34.       if(_currentframe == 1)
  35.       {
  36.          bomb();
  37.          time = 0;
  38.       }
  39.    }
  40.    if(!damage)
  41.    {
  42.       if(this.box.hitTest(_root.car))
  43.       {
  44.          _root.cSound();
  45.          damage = true;
  46.          health -= 20;
  47.          _root.car.ySpeed = (- _root.car.ySpeed) * 0.3;
  48.       }
  49.    }
  50.    if(damage)
  51.    {
  52.       _alpha = random(100) + 10;
  53.       t++;
  54.       if(t > 20)
  55.       {
  56.          t = 0;
  57.          _alpha = 100;
  58.          damage = false;
  59.       }
  60.    }
  61.    if(_root.car.dead)
  62.    {
  63.       ufoS.stop();
  64.    }
  65. }
  66.